package cn.smxy.admin.service.impl;

import cn.smxy.admin.service.CollegeService;
import cn.smxy.client.CollegeClient;
import cn.smxy.param.CollegePlantPageParam;
import cn.smxy.param.CollegeSearchParam;
import cn.smxy.pojo.College;
import cn.smxy.util.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class CollegeServiceImpl implements CollegeService {

    @Autowired
    private CollegeClient collegeClient;

    /**
     * 分页展示学校
     *
     * @param collegeSearchParam
     * @return
     */
    @Override
    public R page(CollegeSearchParam collegeSearchParam) {
        return collegeClient.page(collegeSearchParam);
    }

    /**
     * 删除学校
     *
     * @param collegeId
     * @return
     */
    @Override
    public R remove(Long collegeId) {
        return collegeClient.remove(collegeId);
    }

    /**
     * 分页展示校园作品
     *
     * @param collegePlantPageParam
     * @return
     */
    @Override
    public R plantPage(CollegePlantPageParam collegePlantPageParam) {
        return collegeClient.plantPage(collegePlantPageParam);
    }

    /**
     * 删除校园作品
     *
     * @param plantId
     * @return
     */
    @Override
    public R plantRemove(Long plantId) {
        return collegeClient.removePlant(plantId);
    }

    /**
     * 修改学校信息
     *
     * @param college
     * @return
     */
    @Override
    public R update(College college) {
        return collegeClient.update(college);
    }

    /**
     * 添加学校
     *
     * @param college
     * @return
     */
    @Override
    public R save(College college) {
        return collegeClient.save(college);
    }
}
